package org.hoefling.ontology;

/**
 *
 * @author Kseniya
 */
public class StrategyMinRisk implements BiddingStrategy {

    @Override
    public int offer(int currPrice, int assets, int itemsToGain) {
        double utility = 1 - (double) Math.pow(currPrice, 2) / Math.pow(assets, 2);
        int newPrice = currPrice + 1;
        // the bid is being incremented as long the bidder has any assets left
        return newPrice > utility * assets / itemsToGain ? Integer.MIN_VALUE : newPrice;
    }
}
